package com.exercise.DesignPattern.StructuralPatterns.CompositePattern;

//客户端
public class Client {

    public static void main(String[] args) {
        Composite root = new Composite();
        Component leaf1 = new Leaf();
        Component leaf2 = new Leaf();

        root.add(leaf1);
        root.add(leaf2);
        root.operation();  // 统一调用
    }
}
